/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package presentation.controller;

import java.net.InetAddress;
import logic.facade.StudentFacade;
import vo.StudentVO;

/**
 *
 * @author Admin
 */
public class ControlPanelMyAccount {
    
    public vo.StudentVO obtenerDatos(String vo){
        StudentVO alumno = null;
        alumno = (StudentVO) new StudentFacade().find(vo);
        return alumno;
    }
    
    /**
     * Busca el usuario activo en base a su IP
     * @return El usuario buscado
     */
    public StudentVO findByIp(){
        StudentVO al = null;
        try {
            InetAddress addr = InetAddress.getLocalHost();
            String ip = addr.getHostAddress();
            
            al = new StudentFacade().findByIp(ip + ".true");
        } 
        catch (Exception e) {
            e.printStackTrace();
        }
        
        return al;
    }
}
